package com.fishingwithme.infrastructure;

import lombok.Getter;
import org.springframework.security.authentication.AbstractAuthenticationToken;
class WeChatAuthenticationToken extends AbstractAuthenticationToken {

    private final String code;
    @Getter
    private final String username;
    @Getter
    private final String avatarUrl;

    @Getter
    private final String nickName;

    public WeChatAuthenticationToken(String code, String username, String nickName,String avatarUrl) {
        super(null);
        this.code = code;
        this.username = username;
        this.nickName = nickName;
        this.avatarUrl = avatarUrl;
        setAuthenticated(false);
    }

    @Override
    public Object getCredentials() {
        return null;
    }

    @Override
    public Object getPrincipal() {
        return code;
    }

}